package cn.thoughtworks.school.programCenter.repositories;

import cn.thoughtworks.school.programCenter.entities.Topic;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface TopicRepository extends JpaRepository<Topic, Long> {
    List<Topic> findByProgramIdOrderByOrderNumberAsc(Long programId);
    List<Topic> findByProgramIdAndVisibleOrderByOrderNumberAsc(Long programId, Boolean visible);
    List<Topic> findByProgramId(Long programId);

    List<Topic> findByProgramIdInAndVisibleIsTrueOrderByOrderNumberAsc(List<Long> programIds);

}
